package com.java.example.bean

class MultipleEntityBuilder {
    init {
        FIELDS.clear()
    }


    fun setItemType(itemType: Int): MultipleEntityBuilder {
        FIELDS[MultipleFields.ITEM_TYPE] = itemType
        return this
    }

    fun setField(key: Any, value: Any): MultipleEntityBuilder {
       FIELDS[key] = value
        return this
    }

    fun setFields(map: LinkedHashMap<*, *>?): MultipleEntityBuilder {
       FIELDS.putAll(map!!)
        return this
    }

    fun build(): MultipleItemEntity {
        return MultipleItemEntity(FIELDS)
    }

    companion object {
        private val FIELDS = LinkedHashMap<Any, Any>()
    }
}
